Decrypt R1 and validate the MACLSAM

 

Command:

To decrypt R1 and validate the MACLSAM

Notes:

Use of this command requires the optional ESP licence. Error code 67 will be returned if the command is not licensed.  

This command is complementary to the SA command in the Load Acquirer commands that generates the encrypted R1

 

Field

Length & Type

Details

COMMAND MESSAGE

Message Header

m A

Will be returned to the Host unchanged

Command Code

2 A

Value “U0”

TPK

16 H or 1A + 32H

The Terminal PIN key encrypted under LMK pair 14-15. A single length TPK will be input as 16 hexadecimal characters. A double length TPK will be input as a ‘U’ character followed by 32 hexadecimal characters.

R1Length

1 N

The length of the key R1

Value of '1' represents single length

Value of '2' represents double length

R1

16 H or 32 H

The session key encrypted under the TPK.

DDCEPLength

1 B

The length in bytes of the DDCEP field. The length is specified in binary and must be in the range 00H to 20H (equivalent to 0 to 32 decimal)

IDISS

4 B

The Issuer ID

IDCEP

6 B

The CEP Card Identifier

NTCEP

2 B

The transaction number assigned by the card

CURRLDA

3 B

The Currency Indicator

IDLACQ

4 B

Load Acquirer ID

IDLDA

6 B

The Identifier for the Load Device

MLDA

4 B

The Transaction amount

S1

8 B

The CEP Card signature produced by the card during 'Card Initialise for Load'.

HCEP

10 B

The SHA-1 Hash generated by the CEP card on the Load Transaction data.

HLSAM

8 B

SHA-1 hash of internally generated RLSAM

H2LSAM

8 B

SHA-1 hash of internally generated R2LSAM

DDCEP

0-32 B

Discretionary Data.

MACLSAM

4 B

EMV MAC of Transactional data.

End Message Delimiter

1 C

Optional. Must be present if a message trailer is present. Value X'19

Message Trailer

n A

Optional. Maximum length 32 characters

  

RESPONSE MESSAGE

Message Header

m A

Will be returned to the Host unchanged

Response Code

2 A

Value “U1”

Error Code

2 N

00 – No error. MAC validated successfully

01 – MAC validation error

11 – TPK parity error

12 – No keys loaded in user storage

13 – LMK error - report to Supervisor

15 – Error in input data

21 – Invalid user storage index

70 – Invalid R1Length code

72 – R1 Parity Error

  

End Message Delimiter

1 C

Will only be present if present in the command message. Value X'19

Message Trailer

n A

Will only be present if in the command message. Maximum length 32 characters